package com.typhoon.extend.util;

import java.awt.Menu;
import java.util.List;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;

import com.typhoon.extend.constant.ShiroConstants;
import com.typhoon.extend.dto.UserDto;
/**
 * shiro工具类
 * @author Typhoon
 *
 */
public class SessionUtils {
	
    public static UserDto getUser() {
        return (UserDto) SecurityUtils.getSubject().getSession().getAttribute("user");
    }

    
    @SuppressWarnings("unchecked")
    public static List<Menu> getMenus() {
        Session session = SecurityUtils.getSubject().getSession();
        return (List<Menu>) session.getAttribute(ShiroConstants.SYS_MENU_LIST);
    }
}
